home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
gtalk
/
gtalk.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
3KB
|
81 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import jabber
from logging import getLogger
from common.actions import action
from gtalkStream import GoogleTalkStream
log = getLogger('gtalk.protocol')
status_state_map = {
'available': 'normal',
'free for chat': 'normal',
'do not disturb': 'dnd' }
GTALK_WAY = False
class GoogleTalk(jabber.protocol):
name = 'gtalk'
service = 'gtalk'
status_state_map = status_state_map
def __init__(self, username, *a, **k):
self._idle = None
self._show = None
if '@' not in username:
username += '@gmail.com'
jabber.protocol.__init__(self, username, *a, **k)
self.stream_class = GoogleTalkStream
if not GTALK_WAY:
def set_idle(self, yes):
if yes:
self._idle = self.show
self.show = 'away'
else:
self.show = self._idle
self.presence_push()
def set_message(self, message, status, format = None):
log.info('set_message(%s): %r', status, message)
state = status_state_map.get(status.lower(), 'dnd')
self.show = None if state != 'normal' else None
self._idle = self.show
self.status = message
self.presence_push()
else:
def set_idle(self, yes):
self._idle = bool(yes)
self.presence_push()
def set_message(self, message, status, format = None, default_status = 'dnd'):
jabber.protocol.set_message(self, message, status, format, default_status)
def __set_show(self, state):
self._show = state
def __get_show(self):
if self._idle:
return 'away'
else:
return self._show
show = property(__get_show, __set_show)
def change_password(self, *a):
pass
change_password = action((lambda self: pass))(change_password)
def edit_vcard(self, *a, **k):
pass
edit_vcard = action((lambda self: pass))(edit_vcard)